vector <int> pif(string &s)
{
	vector <int> pi(s.length(), 0);
	for (int i = 1; i < s.length(); i++)
	{
		int k = pi[i - 1];
		while (k > 0 && s[i] != s[k])
			k = pi[k - 1];
		k += (s[i] == s[k]) ? 1 : 0;
		pi[i] = k;
	}
	return pi;
}

/*
//	searching substring using pif().
	string what, inwhat;
	getline(cin, inwhat);
	getline(cin, what);

	inwhat = what + "#" + inwhat;
	vector <int> result = pif(inwhat);

	int len = what.length();
	forx(loop, result.size())
	{
		if (result[loop] == len)
			cout << (loop - 2 * len) _;
	}
	cout eol;
*/